<?php

namespace App\Http\Controllers\Admin\System;

use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Cache;

class CacheController extends Controller
{
    public function __construct()
    {
        view()->share([
            '_system' => 'am-in',
            '_cache' => 'am-active',
        ]);
    }

    /**
     * 缓存首页
     */
    public function index()
    {
        return view('admin.system.cache.index');
    }

    /**
     * 清除缓存
     */
    public function destroy()
    {
        Cache::flush();
        return back()->with('success','清除缓存成功！！');
    }

}
